<!DOCTYPE html>
<html>
<head>
	<!-- 公共页面 -->
	#include("../include/common.html")
	<!-- 公共页面 /-->
</head>
<body class="hold-transition skin-purple sidebar-mini">
    <div class="wrapper">
        <!-- 页面头部 -->
        #include("../include/header.html")
        <!-- 页面头部 /-->
        <!-- 导航侧栏 -->
        #include("../include/menu.html")
        <!-- 导航侧栏 /-->
        <!-- 内容区域 -->
        <div class="content-wrapper" id="contentDiv">
            <!-- 正文区域 -->
            <section class="content">
				<!-- .box-body -->
				<form id="listForm" action="#(base)/admin/site" method="post">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">站点管理</h3>
                    </div>
                    <div class="box-body">
                        <!-- 数据表格 -->
                        <div class="table-box">
                            <!--工具栏-->
                            <div class="pull-left">
                                <div class="form-group form-inline">
                                    <div class="btn-group">
                                        <button type="button" class="btn btn-default" onclick='location.href="#(base)/admin/site/add"'><i class="fa fa-file-o"></i> 新建</button>
                                        <button type="button" class="btn btn-default disabled" id="deleteButton" url="#(base)/admin/site/delete"><i class="fa fa-trash-o"></i> 删除</button>
                                        <button type="button" class="btn btn-default" id="refreshButton"><i class="fa fa-refresh"></i> 刷新</button>
                                        <button type="button" class="btn btn-default" id="sortButton" url="#(base)/admin/site/updateSort"><i class="fa fa-sort"></i> 排序</button>
                                    </div>
                                </div>
                            </div>
                            <!--工具栏/-->
                            <!--数据列表-->
                            <table id="listTable" class="table table-bordered table-striped table-hover dataTable">
                                <thead>
                                    <tr>
                                        <th width="40"><input type="checkbox" id="selectAll" /></th>
	                                    <th>ID</th>
	                                    <th>名称</th>
	                                    <th>域名</th>
	                                    <th>协议</th>
	                                    <th>PC模板</th>
                                        <th>手机端模板</th>
	                                    <th>URL目录</th>
	                                    <th>是否默认站点</th>
	                                    <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody id="listTr">
                                	#for(site : page.list)
	                                <tr>
	                                    <td>#if(!site.isDefault)<input type="checkbox" name="ids" value="#(site.id)" />#end</td>
	                                    <td>#(site.id)</td>
	                                    <td>#(site.name)</td>
	                                    <td>#(site.domain)</td>
	                                    <td>#(site.protocol)</td>
	                                    <td>#(site.pcTemplate)</td>
                                        <td>#(site.mobileTemplate)</td>
	                                    <td>#(site.cat)</td>
	                                    <td>#if(site.isDefault) 是 #else 否 #end</td>
	                                    <td>
	                                    	<button type="button" class="btn bg-olive btn-xs" onclick='location.href="#(base)/admin/site/edit?id=#(site.id)"'>编辑</button>
                                            #if(!site.isDefault)
                                            <button type="button" class="btn bg-olive btn-xs" onclick='location.href="#(base)/admin/site/setDefault?id=#(site.id)"'>设置为默认站点</button>
                                            #end
	                                    </td>
	                                </tr>
	                                #end
                                </tbody>
                            </table>
                            <!--数据列表/-->
                        </div>
                        <!-- 数据表格 /-->
                    </div>
                    <!-- /.box-body -->
                    <!-- .box-footer-->
                    #page(pageNumber = page.pageNumber,totalPages = page.totalPage,pattern = "")
				        #include("../include/page.html")
		            #end
                    <!-- /.box-footer-->
                </div>
                </form>
            </section>
            <!-- 正文区域 /-->
        </div>
        <!-- 内容区域 /-->
        <!-- 底部导航 -->
        #include("../include/footer.html")
        <!-- 底部导航 /-->
    </div>
</body>
</html>
<!---->
<script>
 $(document).ready(function() {
     // 激活导航位置
     setSidebarActive("admin-site");
 });
</script>